import sys
import os
import traceback
print(sys.argv)
args = sys.argv[1:]
def print_help():
    print("command format: -p <av_shorthand>|<weblink> -o <absolute address of destination folder>")
if len(args) == 0:
    print_help()
    sys.exit(0)
    exit(0)
try:
    assert len(args) == 4
    stubs = ["-p","-o"]
    cmds = []
    for stub in stubs:
        assert stub in args
        assert args.count(stub) == 1
        cmd = args[args.index(stub)+1]
        assert cmd not in stubs
        cmds.append(cmd)
    assert cmds[1].startswith("/")
    assert os.path.exists(cmds[1])
except:
    traceback.print_exc()
    print_help()
